package com.wrupple.muba.catalogs.server.state.impl;

import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.wrupple.muba.catalogs.server.domain.CatalogActionStateBag;
import com.wrupple.muba.catalogs.server.service.CatalogResponseHandler;
import com.wrupple.muba.catalogs.server.state.catalogEngine.CatalogResponseWriter;
import com.wrupple.muba.common.shared.StateTransition;
import com.wrupple.vegetate.server.integration.HttpServletResponseHandler;

public class CatalogResponseWriterImpl implements CatalogResponseWriter {

	CatalogResponseHandler handler;
	
	@Inject
	public CatalogResponseWriterImpl(CatalogResponseHandler handler) {
		super();
		this.handler = handler;
	}


	@Override
	public void start(final CatalogActionStateBag parameter,
			StateTransition<HttpServletResponseHandler> onDone, EventBus bus) {
		handler.setStateBag(parameter);
		onDone.setResultAndFinish(handler);
	}

}
